
<html><HEAD>
<LINK REL=STYLESHEET HREF="default.css" TYPE="text/css">
<TITLE>
Supported Adaptive Server datatypes</TITLE>
</HEAD>
<BODY>

<!-- Header -->
<p class="ancestor" align="right"><A HREF="connpbp35.htm">Previous</A>&nbsp;&nbsp;<A HREF="connpbp37.htm" >Next</A>
<!-- End Header -->
<A NAME="CIAIDFDG"></A><h1>Supported Adaptive Server datatypes</h1>
<A NAME="TI691"></A><p>The Adaptive Server interface supports the Sybase datatypes
listed in <A HREF="connpbp36.htm#BABFAEDF">Table 7-1</A> in DataWindow objects and
embedded <ACRONYM title = "sequel" >SQL</ACRONYM>.</p>
<A NAME="BABFAEDF"></A><table cellspacing=0 cellpadding=6 border=1 frame="void" rules="all"><caption>Table 7-1: Supported datatypes for Adaptive
Server Enterprise</caption>
<tr><td  rowspan="1"  ><A NAME="TI692"></A>Binary</td>
<td  rowspan="1"  ><A NAME="TI693"></A>NVarChar </td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI694"></A>BigInt (15.x
and later)</td>
<td  rowspan="1"  ><A NAME="TI695"></A>Real</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI696"></A>Bit</td>
<td  rowspan="1"  ><A NAME="TI697"></A>SmallDateTime</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI698"></A>Char (see <A HREF="connpbp36.htm#BABJIBAF">"Column-length limits"</A>)</td>
<td  rowspan="1"  ><A NAME="TI699"></A>SmallInt</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI700"></A>DateTime</td>
<td  rowspan="1"  ><A NAME="TI701"></A>SmallMoney</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI702"></A>Decimal</td>
<td  rowspan="1"  ><A NAME="TI703"></A>Text</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI704"></A>Double precision</td>
<td  rowspan="1"  ><A NAME="TI705"></A>Timestamp</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI706"></A>Float</td>
<td  rowspan="1"  ><A NAME="TI707"></A>TinyInt</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI708"></A>Identity</td>
<td  rowspan="1"  ><A NAME="TI709"></A>UniChar</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI710"></A>Image</td>
<td  rowspan="1"  ><A NAME="TI711"></A>UniText (15.x and later)</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI712"></A>Int</td>
<td  rowspan="1"  ><A NAME="TI713"></A>UniVarChar</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI714"></A>Money</td>
<td  rowspan="1"  ><A NAME="TI715"></A>VarBinary</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI716"></A>NChar </td>
<td  rowspan="1"  ><A NAME="TI717"></A>VarChar</td>
</tr>
<tr><td  rowspan="1"  ><A NAME="TI718"></A>Numeric</td>
<td  rowspan="1"  ><A NAME="TI719"></A></td>
</tr>
</table>
<A NAME="TI720"></A><p>In Adaptive Server 15.0 and later, PowerBuilder supports unsigned
as well as signed <b>bigint</b>, <b>int</b>,
and <b>smallint</b> datatypes. You can also use the
following datatypes as identity columns in Adaptive Server 15.0
and later: <b>bigint</b>, <b>int</b>, <b>numeric</b>, <b>smallint</b>, <b>tinyint</b>, <b>unsigned
bigint</b>, <b>unsigned int</b>, and <b>unsigned
smallint</b>.</p>
<A NAME="TI721"></A><h4>Accessing Unicode data</h4>
<A NAME="TI722"></A><p>PowerBuilder can connect, save, and retrieve data in both ANSI/DBCS
and Unicode databases. When character data or command text is sent
to the database, PowerBuilder sends a DBCS string if the UTF8 database
parameter is set to 0 (the default). If UTF8 is set to 1, PowerBuilder sends
a UTF-8 string. The
database server must be configured correctly to accept UTF-8 strings.
See the description of the UTF8 database parameter in the online
Help for more information.</p>
<A NAME="TI723"></A><p>The character set used by an Adaptive Server database server
applies to all databases on that server. The <b>nchar</b> and <b>nvarchar</b> datatypes
can store UTF-8 data if the server character set is UTF-8. The Unicode
datatypes <b>unichar</b> and <b>univarchar</b> were
introduced in Adaptive Server 12.5 to support Unicode data. Columns
with these datatypes can store <i>only</i> Unicode
data. Any data saved into such a column must be converted to Unicode
explicitly. This conversion must be handled by the database server
or client.</p>
<A NAME="TI724"></A><p>In Adaptive Server 12.5.1 and later, additional support for
Unicode data has been added. For more information, see the documentation
for your version of Adaptive Server.</p>
<A NAME="BABBHHJE"></A><h4>Different display values
in painters</h4>
<A NAME="TI725"></A><p>The <b>unichar</b> and <b>univarchar</b> datatypes
support UTF-16 encoding, therefore each <b>unichar</b> or <b>univarchar</b> character
requires two bytes of storage. The following example creates a table
with one unichar column holding 10 Unicode characters: <p><PRE> create table unitbl (unicol unichar(10))</PRE></p>
<A NAME="TI726"></A><p>In the Database painter, the column displays as <FONT FACE="Courier New">unichar(20)</FONT>because
the column requires 20 bytes of storage. This is consistent with
the way the column displays in Sybase Central. </p>
<A NAME="TI727"></A><p>However, the mapping between the Type in the Column Specifications
view in the DataWindow painter and the column datatype of a table in the
database is not one-to-one. The Type in the Column Specifications
view shows the DataWindow column datatype and DataWindow column
length. The column length is the number of characters, therefore
an Adaptive Server <FONT FACE="Courier New">unichar(20)</FONT>column
displays as <FONT FACE="Courier New">char(10)</FONT> in
the Column Specifications view. </p>
<A NAME="BABJIBAF"></A><h4>Column-length limits</h4>
<A NAME="TI728"></A><p>Adaptive Server 12.0 and earlier have a column-length limit
of 255 bytes. Adaptive Server 12.5.x and later support wider columns
for <b>Char</b>, <b>VarChar</b>, <b>Binary</b>,
and <b>VarBinary</b> datatypes, depending on the logical
page size and the locking scheme used by the server. </p>
<A NAME="TI729"></A><p>In PowerBuilder, you can use these wider columns for <b>Char</b> and <b>VarChar</b> datatypes
with Adaptive Server 12.5.x when the following conditions apply:<A NAME="TI730"></A>
<ul>
<li class=fi>The Release database parameter is set to 12.5 or
higher.</li>
<li class=ds>You are accessing the database using Open Client
12.5.x or later.
</li>
</ul>
</p>
<A NAME="TI731"></A><p>The database must be configured to use a larger page size
to take full advantage of the widest limits. </p>
<A NAME="TI732"></A><p>For detailed information about wide columns and configuration
issues, see the Adaptive Server documentation on the <A HREF="http://www.sybase.com/support/manuals/">Product Manuals Web site</A>
. For more information about
the Release database parameter, see the online Help. </p>
<A NAME="TI733"></A><p>When you retrieve or update columns, PowerBuilder converts
data appropriately between the Adaptive Server datatype and the
PowerScript datatype. Similarly or identically named Adaptive Server
and PowerScript datatypes do <i>not</i> necessarily
have the same definitions. For information about the definitions
of PowerScript datatypes, see the <i>PowerScript Reference</i>
.</p>
<A NAME="TI734"></A><h4>Conversion in PowerBuilder scripts</h4>
<A NAME="TI735"></A><p>A double that has no fractional component is converted to
a string with one decimal place if the converted string would cause
Adaptive Server to have an overflow error when parsing the string.
For example: the double value 12345678901234 would cause an overflow
error, so PowerBuilder converts the double to the string value 12345678901234.0.</p>

